
extends ../layout

block content

    form(id='searchForm',role='form',action="/person/search" method="post")
      div.container
        div.row
            div.panel.panel-default(style='margin-top:20px')
                div.panel-body
                    div.row.form-group.form-group-sm(style='margin:0')
                        div.col-sm-3
                            div.input-group
                                span.input-group-addon='用户名称'
                                div.input-group.col-sm-12
                                    input(name='personName',placeholder='请输入用户名称',class='form-control' )
                        div.col-sm-3
                            div.input-group
                                span.input-group-addon='用户性别'
                                div.input-group.col-sm-12
                                    input(name='personSex',placeholder='请输入用户性别',class='form-control' )
                        div.col-sm-2
                            button.person-sreach(type='submit',class='btn btn-primary btn-sm',id='qryBtn') 查询
        div.panel.panel-default
            div.person-panel-heading
                div.pull-left.person-new
                     span.glyphicon.glyphicon-user
                     span 用户管理
                div.pull-right
                    a(type="button" data-toggle="modal" data-target="#myModal")
                      span.glyphicon.glyphicon-plus.person-add
                div.clearfix
            table.table.table-bordered.table-hover.table-striped.table-condensed.person-refence
                    thead
                        tr
                            th.align-center('width=5%')='编号'
                            th.align-center('width=20%')='姓名'
                            th.align-center('width=20%')='性别'
                            th.align-center('width=20%')='年龄'
                            th.align-center('width=20%')='联系方式'
                            th.align-center('width=15%')='操作'

                    tbody
                        each personDate,index in dataList1
                            tr
                                td.align-center= personDate.id
                                td.align-center= personDate.person_name
                                td.align-center= personDate.person_sex
                                td.align-center= personDate.person_age
                                td.align-center= personDate.person_contact_information
                                td.align-center
                                    a.btn.btn-default.btn-xs.btn-update.person-edit(data-toggle="modal" data-target="#personUpdateModal" data-id='#{personDate.id}')='修改'
                                    a.btn.btn-default.btn-xs.btn-del.person-delete(href="/person/delate/'#{personDate.id}'" style='margin-left:10px')='删除'

    //新建窗口
    div.modal.fade(id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel")
        div.modal-dialog(role="document")
            div.modal-content
                div.modal-header
                    button.close(type="button"  data-dismiss="modal" aria-label="Close")
                        span(aria-hidden="true")
                    h4.modal-title="新建用户"
                div.modal-body
                    div.row
                        form.form-horizontal(id='createForm' role='form' method='post' action="/person/add" )
                            div.row.form-group.form-group-sm(style='text-align: center')
                                div.form-group.form-group-sm
                                    label.col-sm-4.control-label="姓名"
                                        span(style="color:red;font-weight:bolder")="*"
                                    div.col-sm-6
                                        input.form-control.input-md(type="text"  name="personName"  )
                                div.form-group.form-group-sm
                                    label.col-sm-4.control-label="性别"
                                       span(style="color:red;font-weight:bolder")="*"
                                    div.col-sm-6
                                        input.form-control.input-md(type="text"  name="personSex"  )
                                div.form-group.form-group-sm
                                    label.col-sm-4.control-label="年龄"
                                        span(style="color:red;font-weight:bolder")="*"
                                    div.col-sm-6
                                        input.form-control.input-md(type="text"  name="personAge"  )
                                div.form-group.form-group-sm
                                    label.col-sm-4.control-label="联系方式"
                                         span(style="color:red;font-weight:bolder")="*"
                                    div.col-sm-6
                                        input.form-control.input-md(type="text"  name="personContactInformation"  )
                            div.modal-footer
                                button.person-preservation.btn.btn-primary(type="submit")="保存"
                                button.btn.btn-default(type="button" data-dismiss="modal")="关闭"



    //修改信息窗口
    div.modal.fade(id="personUpdateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel")
        div.modal-dialog(role="document" aria-hidden="true")
            div.modal-content
                div.modal-header
                    button.close(type="button"  data-dismiss="modal" aria-label="Close")
                        span(aria-hidden="true")
                    h4.modal-title="编辑用户信息"
                div.modal-body


    script.
        $(function () {
            $('#person-management').addClass('select-active')
        })